This invention relates generally to producer/consumer software and, more specifically, to methods and systems for exchanging data between a producer and a consumer.
Generally, I/O scanning mechanisms utilize software implementations that include a producer and a consumer configured to exchange data across a module using shared memory buffers. Further, the data exchange typically requires a handshake mechanism across a backplane to allow access to the data. Specifically, the producer requires access to write the data to the shared memory buffer and the consumer requires access to read the data from the shared memory buffer. Accordingly, during the data exchange, at least some known scanning mechanisms require the producer and/or the consumer to wait for access to the data. Specifically, the handshake mechanism may require multiple read or write accesses. For example, a shared memory semaphore, such as the Peterson Algorithm is commonly implemented to ensure coherent access to a shared memory data buffer. However, such semaphores often require repeated attempts to gain access. Further, some known scanning mechanisms require critical regions or timeouts while one of the producer and/or the consumer catches up with the most recent data. Calculating such wait times or timeouts can be difficult and error prone.
Accordingly, at least some known scanning mechanisms send a command to the scanning module to prepare for controller access. However, this mechanism often requires the module to delay its normal processing to read the command, thereby causing delays in the data exchange. Further, at least some known scanning mechanisms use a hardware mechanism to assist with access control. However, hardware mechanisms can be costly and/or time consuming to install and maintain.